import { useReactive } from "ahooks";
import { useModel } from "umi";
import { useEffect } from "react";
import compress from "gql-compress";

const useAllUseRecharge = () => {
    const { graphqlFetch } = useModel("global");

    const state = useReactive({
        useRechargeLoading: false,
        useRecharge: [],
    });

    const loadAllUseRecharge = async () => {
        state.useRechargeLoading = true;
        // let res = await graphqlFetch({
        //     query,
        //     variables: {},
        // });
        // let commodities = res?.a?.nodes || [];
        let useRecharge = {}
        state.useRecharge = useRecharge;
        state.useRechargeLoading = false;
        // return commodities;
    };

    return { ...state, loadAllUseRecharge };
};

//查询正在使用的充值方案
const query = compress(``);

export default useAllUseRecharge;
